<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lesson 7</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
  <div id="root"></div>
</body>
<script>
  // slot 作用域插槽

  const app = Vue.createApp({

    data(){
      return {
        title: '提交111'
      }
    },

    template: `
      <div>
      <myList v-slot="{item}">
        <div>{{item}}</div>
      </myList>
      </div>
    `
  });


  app.component('myList', {
    props: ['content'],
    data() {
      return {
        list: [1,2,3,4,5,6]
      }
    },
    methods: {
      handleClick(){
        alert(123);
      },
    },
    template: `
      <div>
        <slot v-for="(item,index) in list" :item="item"/>
      </div>
      `
  })


  const vm = app.mount('#root');
</script>
</html>